package com.DosonLeung.homeschoolcommunication.Utils;

import android.view.View;
import android.view.animation.AnimationSet;
import android.view.animation.RotateAnimation;

/**
 * Created by DosonLeung on 2014/11/2.
 */
public class AnimationUtil {
    public static RotateAnimation spin(View v) {
        final View v_final = v;
        AnimationSet as = new AnimationSet(true);
        final float w = v_final.getWidth() / 2;
        final float h = v_final.getHeight() / 2;
        RotateAnimation ra = new RotateAnimation(0, 180, w, h);
        ra.setDuration(300);
        as.addAnimation(ra);
        v_final.startAnimation(as);
        return ra;
    }
}
